<template>
<div>

  <el-descriptions title="查看品类" :column="1">
    <el-descriptions-item label="品类名称">{{productType.name}}</el-descriptions-item>
    <el-descriptions-item label="品类顺序">{{productType.priority}}</el-descriptions-item>
    <el-descriptions-item label="子品类">
      <el-tag
        v-for="tag in productType.subClasses"
        :key="tag.name"
        type="">
        {{tag.name}}
      </el-tag>
    </el-descriptions-item>
    <el-descriptions-item label="品类描述">{{productType.des}}</el-descriptions-item>
  </el-descriptions>

</div>
</template>

<script>
import {getById} from "@/api/ProductType";

export default {
  name: "ProductTypeDetail",
  data: function () {
    return {
      id: '',
      productType: {},
    }
  },
  created() {
    this.id = this.$route.params.id;
    this.getOne();
  },
  methods: {
    getOne: async function () {
      this.productType = await getById(this.id);
    }
  }

}
</script>

<style scoped>

</style>
